package com.noble.meether.chat.ui.agora.act.bean;

import com.noble.library.base.bean.BaseData;

import org.json.JSONObject;

import java.util.List;

/**
 * 音视频通信中礼物跑马灯列表
 * Created by Su on 2017/7/18.
 */
public class RtcGiftList extends BaseData {
    private List giftList;

    public List getGiftList() {
        return giftList;
    }

    @Override
    public void parseJson(String s) {
        String jsonData = getJsonObject(s).optString("res");
        JSONObject jsonObject = getJsonObject(jsonData);
        giftList = getBaseDataList(jsonObject.optJSONArray("banners"), GiftInfo.class);
    }

    public static class GiftInfo extends BaseData {
        private String from_name;
        private String to_name;
        private int gift_id;
        private int count;

        @Override
        public void parseJson(String s) {
            JSONObject jsonObject = getJsonObject(s);
            this.setFrom_name(jsonObject.optString("from_name"));
            this.setTo_name(jsonObject.optString("to_name"));
            this.setGift_id(jsonObject.optInt("gift_id"));
            this.setCount(jsonObject.optInt("count"));
        }

        public String getFrom_name() {
            return from_name;
        }

        public void setFrom_name(String from_name) {
            this.from_name = from_name;
        }

        public String getTo_name() {
            return to_name;
        }

        public void setTo_name(String to_name) {
            this.to_name = to_name;
        }

        public int getGift_id() {
            return gift_id;
        }

        public void setGift_id(int gift_id) {
            this.gift_id = gift_id;
        }

        public int getCount() {
            return count;
        }

        public void setCount(int count) {
            this.count = count;
        }
    }
}
